package org.feng.condition;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import jakarta.servlet.http.HttpServletRequest;
import org.feng.utils.HttpUtils;

/**
 * 条件构造器
 *
 * @author : FengShuai
 * @since : 2024/6/27 9:24
 */
public class Condition {
    /**
     * 分页构造器
     */
    public static <T> IPage<T> getPage() {
        HttpServletRequest request = HttpUtils.getRequest();
        String current = request.getParameter("currentPage");
        String size = request.getParameter("pageSize");
        return new Page<>(Long.parseLong(current), Long.parseLong(size));
    }
}
